<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class PermissionTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
		$menus = DB::table('menus')->where('permission','not like','menu%')->get();
		$permissions = [];
		foreach($menus as $v){
			$permissions[] = ['name'=>$v->permission,'display_name'=>$v->name];
		}
		DB::table('permissions')->insert($permissions);
    }
}
